<?php
//echo "<script>window.location='index.php?module=naujienos';</script>";
//$result=mysql_query("select * from news ORDER BY id DESC"); //meniu isvedimas
//$i=0;
//while ($row = mysql_fetch_assoc($result)) {

echo "Failų archyvas";
echo "<br>";
echo "
<form action='template/failer.php' method='post' enctype='multipart/form-data'>
   <p>
      <label for='file'>Pasirinkite failą:</label> 
      <input type='file' name='userfile' id='file'>
      <input type='submit' value='siųsti failą'>
   <p>
</form>";

//zapis v folder i mysql
echo "postas".$_FILES['userfile']['name'];
$uploads_dir = '../failer/';
$dir=$uploads_dir.$_FILES["userfile"]["name"];

echo $_FILES["userfile"]["type"];
move_uploaded_file($_FILES["userfile"]["tmp_name"], $dir);
?>